<%@ page language="java" import="java.util.*,org.apache.struts2.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"   %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE HTML>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="<%=basePath %>/assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
	<link href="<%=basePath %>/assets/css/bui-min.css" rel="stylesheet" type="text/css" />
    <link href="<%=basePath %>/assets/css/page-min.css" rel="stylesheet" type="text/css" />	
    <style type="text/css">
    	/**内容超出 出现滚动条 **/
	    .bui-stdmod-body{
	      overflow-x : hidden;
	      overflow-y : auto;
	    }
    </style>
</head>
<body>
	<div style="margin-left:20px;margin-top:20px;">
		<h3>系统信息</h3>
			<div style="margin-top:10px; margin-left:10px;">
				<div class="row detail-row">
		          <div class="span8">
		            <label>帐号：</label><span class="detail-text">${name}</span>
		          </div>
		          <div class="span8">
		            <label>帐号类型：</label><span class="detail-text">系统管理员</span>
		          </div>
		          <div class="span8">
		            <label>权限：</label><span class="detail-text">无限制</span>
		          </div>
		        </div>
		        <hr>     
		        <div class="row detail-row">
		          <div class="span8">
		          <label>服务器系统型号 ：</label><span class="detail-text">Windows 2008</span>   
		          </div>
		          <div class="span8">
		          <label>服务器 ：</label><span class="detail-text">Tomcat 7.0</span>
		          </div>
		          <div class="span8">
		          <label>您的IP：</label><span class="detail-text"><%=request.getRemoteAddr()%></span>
		          </div>
		        </div>
		        <hr>    
		        <div class="row detail-row">
		          <div class="span8">
		            <label>技术提供 :</label><span class="detail-text">思辰电子商务有限公司</span>
		          </div>
		          <div class="span8">
		            <label >系统 ：</label><span class="detail-text">微超市后台管理系统</span>
		          </div>
		          <div class="span8">
		            <label>系统版本 ：</label><span class="detail-text">微超市后台管理系统 V 1.0.0 </span>
		          </div>
		        </div>
		        <hr>
	        </div>
	        <!-- table 显示的DIV -->
		    <h3>系统通知</h3>
		    <div id="grid"  style="margin-top:20px;"></div>
		    <div class="pagination pull-right"></div>    
        </div>
    <script type="text/javascript" src="<%=basePath %>/assets/js/jquery-1.8.1.min.js"></script>
	<script type="text/javascript" src="<%=basePath %>/assets/js/bui.js"></script>
    <script type="text/javascript">
    	//设定BUI视图变量
    	var Grid = BUI.Grid;
    	//设定BUI数据变量
        var Data = BUI.Data;
        //获取数据
        var Store = Data.Store;
        //定义columns并且初始化
        var columns = [
          //table columns
          {title : '最新消息',dataIndex :'title',width:'100%'},
          {title : '时间',dataIndex:'date',width:200},
          {title : '操作',renderer : function(i){
		    return '<span class="grid-command btn-info">查看详细内容</span>';
		  }},
        ];
        
        //定义store并且通过AJAX获取数据
        var store = new Store({
        	//AJAX 提交路劲
            url : '<%=basePath %>/Json/AdminNews',
            //自动加载数据
            autoLoad:true,
            //从第0个元素开始获取信息 
            start:0,
            //配置分页数目,后台相当于limit参数
            pageSize:5
          });
        var grid = new Grid.Grid({
        	//显示div的id
            render:'#grid',
            //宽度
            width:900,
            //加载columns
            columns : columns,
            //加载数据时显示屏蔽层
            loadMask: true, 
            //加载store
            store: store,
            plugins : [Grid.Plugins.RowNumber,Grid.Plugins.AutoFit],
            // 底部工具栏
           	bbar:{
              pagingBar: {
                xclass: 'pagingbar-number',
              }   
            },
        });
        grid.on('itemclick',function(ev){
	        var sender = $(ev.domTarget);
	        //获取点击的item
	        var item = ev.item;
	        //点击删除操作
	        if(sender.hasClass('btn-info')){
	        	//执行删除函数
	        	showinfoFunction(item);
	        }
        }); 
        
        //加载grid
        grid.render();
        
        //查看详细内容函数
        function showinfoFunction(item){
			var Overlay = BUI.Overlay;
	        var dialog = new Overlay.Dialog({
	            title:item.title,
	            width:'80%',
       			height:350,
	            mask:false,
	            buttons:[
	              {
	                text:'知道了,谢谢',
	                elCls : 'button button-primary',
	                handler : function(){
	                  this.close();
	              	}
	              }
	            ],
	            bodyContent:item.content+'<br><br><h2 style="width:180px;float:right;">'+item.date+'</h2><br><br>'
	          });
	        dialog.show();
        }
    </script>
</body>
</html>
